package com.ruslan.magaz.service;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.transaction.annotation.Transactional;

import com.ruslan.magaz.entity.Info;
import com.ruslan.magaz.entity.InfoName;
import com.ruslan.magaz.entity.User;

public interface InfoService {

	@Transactional
	void addInfo(Info info);
	
	@Transactional
	void removeInfo (int id);
	
	@Transactional
	Info getInfoById(int id);
	
	@Transactional
	Info updateInfo(Info info);
	
	@Transactional
	Page<Info> getInfosByUser(int userId, int firstResult, Integer maxResults);
	
	@Transactional
	List<InfoName> getInfoNames();
	
	@Transactional
	InfoName getInfoNameById(int id);
	
	@Transactional
	int countSameInfo(InfoName infoName, String value);
	
	@Transactional
	int countIdenticalInfo(int id, InfoName infoName, String value);
	
	@Transactional
	int countInfosForUser(User user);
	

	
}
